package service.impl;

import dao.CityDao;
import dao.ProvinceDao;
import domain.City;
import domain.Province;
import jdk.nashorn.internal.runtime.PrototypeObject;
import org.springframework.stereotype.Service;
import service.ProvinceCityService;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author liujunjie
 * @create 2021-10-29 11:13
 */

@Service
public class ProvinceCityServiceImpl implements ProvinceCityService {

    @Resource
    private ProvinceDao provinceDao;

    @Resource
    private CityDao cityDao;

    @Override
    public List<Province> queryAllProvince() {
        return provinceDao.selectProvinceList();
    }

    @Override
    public int addCity(City city) {
        int rows = cityDao.insertCity(city);
        return rows;
    }

    @Override
    public List<City> queryCityByProvinceId(Integer provinceId) {
        return cityDao.selectCityByProvinceId(provinceId);
    }
}
